package com.ruoyi.web.controller.app;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.monitor.service.IBusWaterAutomonitorDaydataService;
import com.ruoyi.monitor.service.IBusWaterAutomonitorevaluateDaydataService;
import com.ruoyi.monitor.service.IBusWaterAutomonitorevaluateHourdataService;
import com.ruoyi.monitor.service.IBusWaterAutomonitorevaluateMonthdataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @Author: yanakai@126.com
 * @CreateDate: 2025/10/7 12:28
 * @UpdateUser: yanakai@126.com
 * @UpdateDate: 2025/10/7 12:28
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@RestController
@RequestMapping("/app/busWaterAutoData")
public class BusWaterAutoMonitorDataController extends BaseController {


    @Autowired
    private IBusWaterAutomonitorevaluateHourdataService busWaterAutomonitorevaluateHourdataService;

    @Autowired
    private IBusWaterAutomonitorevaluateDaydataService busWaterAutomonitorevaluateDaydataService;

    @Autowired
    private IBusWaterAutomonitorDaydataService busWaterAutomonitorDaydataService;

    @Autowired
    private IBusWaterAutomonitorevaluateMonthdataService busWaterAutomonitorevaluateMonthdataService;



    /**
     * @title getWaterAutoEvaluateHourList
     * @description  断面水质评价 小时数据
     * @param request
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    @RequestMapping("/getWaterAutoEvaluateHourList")
    public AjaxResult getWaterAutoEvaluateHourList(HttpServletRequest request){
        //  查询断面表和日评价表
        Map<String, String[]> parameterMap = request.getParameterMap();
        Map<String,Object> params = new HashMap<>();
        for (String s : parameterMap.keySet()) {
            params.put(s,String.join(",",parameterMap.get(s)));
        }
        return AjaxResult.success(busWaterAutomonitorevaluateHourdataService.getWaterAutoEvaluateHourList(params));
    }

    /**
     * @title getWaterAutoMonitorDayList
     * @description  获取断面监测数据小时数据
     * @param request
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    @RequestMapping("/getWaterAutoMonitorHourList")
    public AjaxResult getWaterAutoMonitorHourList(HttpServletRequest request){
        Map<String, String[]> parameterMap = request.getParameterMap();
        Map<String,Object> params = new HashMap<>();
        for (String s : parameterMap.keySet()) {
            params.put(s,String.join(",",parameterMap.get(s)));
        }
        return AjaxResult.success(busWaterAutomonitorevaluateHourdataService.getWaterAutoMonitorHourList(params));
    }


    /**
     * @title getWaterAutoEvaluateDayList
     * @description  水环境质量水质评价日数据列表
     * @param request
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    @RequestMapping("/getWaterAutoEvaluateDayList")
    public AjaxResult getWaterAutoEvaluateDayList(HttpServletRequest request){
        //  查询断面表和日评价表
        Map<String, String[]> parameterMap = request.getParameterMap();
        Map<String,Object> params = new HashMap<>();
        for (String s : parameterMap.keySet()) {
            params.put(s,String.join(",",parameterMap.get(s)));
        }
        return AjaxResult.success(busWaterAutomonitorevaluateDaydataService.getWaterAutoEvaluateDayList(params));
    }

    /**
     * @title getWaterAutoMonitorDayList
     * @description  获取断面监测数据日数据
     * @param request
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    @RequestMapping("/getWaterAutoMonitorDayList")
    public AjaxResult getWaterAutoMonitorDayList(HttpServletRequest request){
        Map<String, String[]> parameterMap = request.getParameterMap();
        Map<String,Object> params = new HashMap<>();
        for (String s : parameterMap.keySet()) {
            params.put(s,String.join(",",parameterMap.get(s)));
        }
        return AjaxResult.success(busWaterAutomonitorDaydataService.getWaterAutoMonitorDayList(params));
    }

    /**
     * @title getWaterAutoEvaluateMonthList
     * @description  查询月的水质评价数据
     * @param request
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    @RequestMapping("/getWaterAutoEvaluateMonthList")
    public AjaxResult getWaterAutoEvaluateMonthList(HttpServletRequest request){
        //  查询断面表和日评价表
        Map<String, String[]> parameterMap = request.getParameterMap();
        Map<String,Object> params = new HashMap<>();
        for (String s : parameterMap.keySet()) {
            params.put(s,String.join(",",parameterMap.get(s)));
        }
        return AjaxResult.success(busWaterAutomonitorevaluateMonthdataService.getWaterAutoEvaluateMonthList(params));
    }
    /**
     * @title getWaterAutoMonitorMonthList
     * @description  查询月的水质监测数据
     * @param request
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    @RequestMapping("/getWaterAutoMonitorMonthList")
    public AjaxResult getWaterAutoMonitorMonthList(HttpServletRequest request){
        Map<String, String[]> parameterMap = request.getParameterMap();
        Map<String,Object> params = new HashMap<>();
        for (String s : parameterMap.keySet()) {
            params.put(s,String.join(",",parameterMap.get(s)));
        }
        return AjaxResult.success(busWaterAutomonitorevaluateMonthdataService.getWaterAutoMonitorMonthList(params));
    }

    /**
     * @title getWaterAutoEvaluateYearList
     * @description  查询年的水质评价数据
     * @param request
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    @RequestMapping("/getWaterAutoEvaluateYearList")
    public AjaxResult getWaterAutoEvaluateYearList(HttpServletRequest request){
        //  查询断面表和日评价表
        Map<String, String[]> parameterMap = request.getParameterMap();
        Map<String,Object> params = new HashMap<>();
        for (String s : parameterMap.keySet()) {
            params.put(s,String.join(",",parameterMap.get(s)));
        }
        return AjaxResult.success(busWaterAutomonitorevaluateMonthdataService.getWaterAutoEvaluateYearList(params));
    }
    /**
     * @title getWaterAutoMonitorMonthList
     * @description  查询年的水质监测数据
     * @param request
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    @RequestMapping("/getWaterAutoMonitorYearList")
    public AjaxResult getWaterAutoMonitorYearList(HttpServletRequest request){
        Map<String, String[]> parameterMap = request.getParameterMap();
        Map<String,Object> params = new HashMap<>();
        for (String s : parameterMap.keySet()) {
            params.put(s,String.join(",",parameterMap.get(s)));
        }
        return AjaxResult.success(busWaterAutomonitorevaluateMonthdataService.getWaterAutoMonitorYearList(params));
    }
}
